package com.bawei.databing_test;

import androidx.databinding.BaseObservable;
import androidx.databinding.Bindable;

public class User extends BaseObservable {

    private String username;//用户名
    private int age;//年龄
    private boolean show;//是否显示
    private String imageUrl;//图片网址
    @Bindable
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
        notifyPropertyChanged(BR.username);//通知数据改变
    }
    @Bindable
    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
        notifyPropertyChanged(BR.age);
    }

    public boolean isShow() {
        return show;
    }

    public void setShow(boolean show) {
        this.show = show;
    }

    public String getImageUrl() {
        return imageUrl;
    }

    public void setImageUrl(String imageUrl) {
        this.imageUrl = imageUrl;
    }

    public User(String username, int age, boolean show, String imageUrl) {
        this.username = username;
        this.age = age;
        this.show = show;
        this.imageUrl = imageUrl;
    }
}
